package Managers;

import Entities.Medium;
import Tools.DatabaseException;
import org.w3c.dom.Document;

import java.util.List;

/**
 * Created by Oliver Mrazik on 10. 5. 2014.
 * author: Oliver Mrazik
 * version: 2014-05-10
 */
public interface MediumManager {

    /**
     * Creates new medium record.
     * @param medium medium to be created
     * @throws DatabaseException when error occurs while creating medium
     */
    public void createMedium(Medium medium) throws DatabaseException, NullPointerException, IllegalArgumentException;

    /**
     * Deletes existing medium.
     * @param medium medium to be deleted
     * @throws DatabaseException when error occurs while deleting medium
     */
    public void deleteMedium(Medium medium) throws DatabaseException;

    /**
     * Updates existing medium.
     * @param medium medium to be updated
     * @throws DatabaseException when error occurs while updating medium
     */
    public void updateMedium(Medium medium) throws DatabaseException;

    /**
     * Returns concrete medium by id.
     * @param id medium's id
     * @return found medium
     * @throws DatabaseException when error occurs while returning medium
     */
    public Medium getMediumById(String id) throws DatabaseException;

    /**
     * Return concrete medium by label.
     * @param label medium's label
     * @return found medium
     * @throws DatabaseException when error occurs while returning medium
     */
    public Medium getMediumByLabel(String label) throws DatabaseException;

    /**
     * Returns list of all mediums.
     * @return list of mediums
     * @throws DatabaseException when error occurs while listing all mediums
     */
    public List<Medium> getAllMediums() throws DatabaseException;
}
